package com.famdoc.Pojo.entity;

import com.famdoc.Pojo.dto.VisitFrom;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 随访实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Visit {
    private Integer id;
    private Integer doctorId;  //随访医生id
    private Integer patientId; //随访患者id
    private Integer checkId; //体检记录id
    private String symptoms; //随访患者症状
    private String drugUsage;  //用药情况
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime visitTime; //随访时间
    private String visitWay; //随访方式
    private String livingHabit; //生活习惯
    private Integer visitSign; //是否完成随访，0代表草稿，1代表完成随访，2代表随访逾期
    private String remark; //备注

    public Visit(VisitFrom visitFrom){
        this.id=visitFrom.getId();
        this.doctorId = visitFrom.getDoctorId();
        this.patientId=visitFrom.getPatientId();
        this.checkId=visitFrom.getCheckId();
        this.symptoms=visitFrom.getSymptoms();
        this.drugUsage=visitFrom.getDrugUsage();
        this.visitTime=visitFrom.getVisitTime();
        this.visitWay = visitFrom.getVisitWay();
        this.livingHabit=visitFrom.getLivingHabit();
        this.visitSign=visitFrom.getVisitSign();
        this.remark=visitFrom.getRemark();
    }
}
